// pub enum BlogStatus {
//     Draf,
//     Pending,
//     Done,
// }

// pub struct Blog {
//     content: String,
//     status: BlogStatus,
// }

// impl Blog {
//     pub fn new(content: String) -> Blog {
//         Blog {
//             content,
//             status: BlogStatus::Draf,
//         }
//     }
//     pub fn get_content(&self) -> &str {
//         // 需要根据状态判断
//         // 只有审核完成的内容才可以查看
//         match self.status {
//             BlogStatus::Done => &self.content,
//             _ => "",
//         }
//     }
//     pub fn approval(&mut self) {
//         self.status = BlogStatus::Pending;
//     }
//     pub fn publish(&mut self) {
//         self.status = BlogStatus::Done;
//     }
// }

pub struct Blog {
    content: String,
}
pub struct DraftBlog {
    content: String,
}
pub struct PendingBlog {
    content: String,
}
impl Blog {
    pub fn new(content: String) -> DraftBlog {
        DraftBlog { content }
    }
    pub fn get_content(&self) -> &str {
        &self.content
    }
}
impl DraftBlog {
    pub fn approval(self) -> PendingBlog {
        PendingBlog {
            content: self.content,
        }
    }
}
impl PendingBlog {
    pub fn publish(self) -> Blog {
        Blog {
            content: self.content,
        }
    }
}
